home *** CD-ROM | disk | FTP | other *** search
- UNPACK(3I) Last changed: 4-13-99
-
-
- NNAAMMEE
- UUNNPPAACCKK - Unpacks an array of rank one into an array under control of a
- mask
-
- SSYYNNOOPPSSIISS
- UUNNPPAACCKK (([VVEECCTTOORR==]_v_e_c_t_o_r,, [MMAASSKK==]_m_a_s_k,, [FFIIEELLDD==]_f_i_e_l_d))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, IRIX systems
-
- CF90, MIPSpro 7 Fortran 90
-
- SSTTAANNDDAARRDDSS
- Fortran
-
- DDEESSCCRRIIPPTTIIOONN
- The UUNNPPAACCKK intrinsic function unpacks an array of rank one into an
- array under control of _m_a_s_k. It accepts the following arguments:
-
- _v_e_c_t_o_r Can be of any type. It must have rank one. Its size must
- be at least _t where _t is the number of true elements in
- _m_a_s_k.
-
- _m_a_s_k Must be of type logical and array valued.
-
- _f_i_e_l_d Must be of the same type as _v_e_c_t_o_r, and must be conformable
- with _m_a_s_k.
-
- UUNNPPAACCKK is a transformational function. The name of this intrinsic
- cannot be passed as an argument.
-
- RREETTUURRNN VVAALLUUEESS
- The result is an array of the same type as _v_e_c_t_o_r and the same shape
- as _m_a_s_k.
-
- The element of the result that corresponds to the _ith true element of
- _m_a_s_k, in array element order, has the value _v_e_c_t_o_r(_i) for _i=1, 2, ...,
- _t where _t is the number of true values in _m_a_s_k. Each other element
- has the value equal to _f_i_e_l_d if _f_i_e_l_d is scalar or to the
- corresponding element of _f_i_e_l_d if it is an array.
-
- EEXXAAMMPPLLEESS
- This example uses UUNNPPAACCKK to scatter specific values to specific
- positions in an array.
-
- Assume that MM is the following array:
-
- | 1 0 0 |
- | 0 1 0 |
- | 0 0 1 |
-
- Assume that VV is the array [1, 2, 3].
-
- Assume that QQ is the logical mask:
-
- | F T F |
- | T F F |
- | F F T |
-
- In logical mask QQ, TT represents true and FF represents false, so
- UUNNPPAACCKK((VV,, MMAASSKK==QQ,, FFIIEELLDD==MM)) has the following value:
-
- | 1 2 0 |
- | 1 1 0 |
- | 0 0 3 |
-
- The result of UUNNPPAACCKK((VV,, MMAASSKK==QQ,, FFIIEELLDD==00)) has the following value:
-
- | 0 2 0 |
- | 1 0 0 |
- | 0 0 3 |
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
- man page.
-